package org.mspring.mlog.dao;

import org.mspring.mlog.entity.Article;
import org.mspring.nbee.orm.dao.IBaseDao;

import java.util.List;

/**
 * @author Gao Youbo
 * @since 2014-12-04 17:58:05
 */
public interface ArticleDao extends IBaseDao<Article> {
    /**
     * 获取文章的点击次数
     *
     * @param articleId
     * @return
     */
    public int getArticleViewCount(long articleId);

    /**
     * 更新文章的点击率
     *
     * @param articleId
     * @param viewCount
     * @return
     */
    public boolean updateArticleViewCount(long articleId, int viewCount);

    /**
     * 列出最新发表的文章
     *
     * @param limit
     * @return
     */
    public List<Article> listLatestArticle(int limit);

    /**
     * 列出热门文章
     *
     * @param limit
     * @return
     */
    public List<Article> listHotArticle(int limit);
}
